from openai import OpenAI

model = [
    "gpt-4o-audio-preview",
    "gpt-4",
    "gpt-4o",
    "gpt-4o-2024-05-13",
    "gpt-4o-2024-08-06",
    "gpt-4o-2024-11-20",
    "chatgpt-4o-latest",
    "gpt-4o-mini",
    "gpt-4o-mini-2024-07-18",
    "gpt-4-turbo",
    "gpt-4-turbo-2024-04-09",
    "gpt-4-turbo-preview"
]
txt = """
1. 涉及个股、行业、概念股价变化解读     # 涉及到个股代码、行业代码或概念名称
2. 大盘实时行情解读
3. 个股诊断、询问个股好不好             # 涉及到个股代码
4. 场内外基金诊断、询问基金、ETF好不好     # 涉及到基金代码 

5. 针对某个市场事件进行解读          # 事件关键词，或 个股/行业/概念名称



对上述 分类做出总分总的分类， 先大类分支，再细分，再汇集到1 2 3 4 5类

"""
msg = [
    {'role': 'system', 'content': "一步一步来，准确的解答"},
    {'role': 'user', 'content': f"{txt}"}
]

client = OpenAI(
    api_key="sk-Uj5fxliGcfRnw0El087b42AfBfFb431b89F461D63fCc4fCa",
    base_url="https://one-api.jrtzcloud.cn/v1"
)

response = client.chat.completions.create(
    model=model[2],
    messages=msg,
    stream=False,
)

# 统计单篇tokens数
print(response)
print("\n====================\n", response.choices[0].message.content, "\n====================")
